package com.emser.unc.server.domain;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class ProductIndex {
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Set<String> userNameSellers;
	
	public ProductIndex(String sellerKey, Key key) {
		this.userNameSellers = new HashSet<String>();
		this.userNameSellers.add(sellerKey);	
		this.key = key;
		}
	public void setKey(Key key) {
		this.key = key;
	}
	
	public void addSellerKey(String sellerKey){
		this.userNameSellers.add(sellerKey);
	}

	public Key getKey() {
		return key;
	}


	public Set<String> getUserNameSellers() {
		return userNameSellers;
	}
	
}
